package edu.cqie.common.util;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

public class PageUtil {

    /**
     * 直接获取 当前请求线程中前端传递的pageSize和current参数
     */
    public static  <T> Page<T> getPage() {

        // 若前端未传递该param 则使用默认值 0
        long pageSize = Long.parseLong(ServletUtil.getRequestParam("pageSize","0"));
        long current = Long.parseLong(ServletUtil.getRequestParam("current","0"));

        return new Page<>(current, pageSize);
    }
}
